package com.gotrade.springbootexceptiondemo.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotNull;
import java.time.LocalDate;

/**
 * @author jason.tang
 * @create 2019/4/28
 * @description 用户
 */

@ApiModel(description = "用户实体类")
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class User {
    @ApiModelProperty(value = "用户编号")
    private Integer userNum;

    @ApiModelProperty(value = "用户名")
    @NotNull(message = "username not empty!")
    private String username;

    @ApiModelProperty(value = "出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthday;
}
